<div class="col-lg-9 mx-auto my-0">

   <h3>User lookup by email:</h3> 

   <p>Moderators and admins have the ability to search for usernames associated with a given email address. This ability is meant to assist in answering requests submitted by email where the user forgets to specify their username; clearly the email address of the sender is known.</p>
   <%= form_tag do %>
       <%= text_field_tag(:address, value = @address, :'aria-label'=>"Enter address") %>
       <%= button_tag(:search, type: 'submit', class: "btn btn-primary", :'aria-label'=>"Search Button") do %>
          <i class="fa fa-search fa fa-white"></i>
       <% end %>
       </button>
       <label class="d-block">
         <input type="checkbox" id="myCheck" name="include_banned" />
         Include banned accounts after 2015 (<em>careful: can result in server slowness for all users</em>)
       </label>
   <% end %>
   
   <br>
   <% if @address %>
   <h4>Searched for <%= @address %>(<%= @users.size %>)</h4>
   <% if @users.size > 0 %>
   <ul>
      <% @users.each do |user| %>
      <li><a href="/profile/<%= user.username %>"><%= user.username %></a></li>
      <% end %>
   </ul>
   <% else %>
   <p>No users found with that email address!</p>
   <% end %>
  <% end %>
</div>
